package com.dc.dao;


import com.dc.entity.ShipEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Optional;

/**
 * 船基础表 数据层
 *
 */
public interface ShipDao extends JpaRepository<ShipEntity, Long>, JpaSpecificationExecutor<ShipEntity> {

    /**
     * 根据条件分页查询船列表
     *
     * @param name 船信息
     * @return 船集合信息
     */
    public Page<ShipEntity> findShipEntitiesByTypeAndName(String type, String name, Pageable pageable);

    public Page<ShipEntity> findShipEntitiesByType(String type, Pageable pageable);

    public Page<ShipEntity> findShipEntitiesByName(String name, Pageable pageable);

    public List<ShipEntity> findShipListByType(String type);

    Optional<ShipEntity> findByName(String name);



}
